home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / popularity-contest.preinst < prev    next >
Text File  |  2009-06-16  |  722b  |  25 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. case "$1" in
  6. install|upgrade)
  7. # Move a conffile without triggering a dpkg question if it was not modified.
  8.     if dpkg --compare-versions "$2" le "1.44"; then
  9.       PKGNAME="popularity-contest"
  10.       CONFFILE="/etc/cron.weekly/popularity-contest"
  11.       NEWCONFFILE="/etc/cron.daily/popularity-contest"
  12.       if [ -e "$CONFFILE" ]; then
  13.           md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  14.           old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`"
  15.           if [ "$md5sum" = "$old_md5sum" ]; then
  16.               rm -f "$CONFFILE"
  17.           else
  18.               mv -f "$CONFFILE" "$NEWCONFFILE"
  19.           fi
  20.       fi
  21.     fi
  22. esac
  23.  
  24.  
  25.